package com.xbongbong.pro.enums.menu.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.paas.constant.PaasConstant;
import com.xbongbong.paas.enums.MenuTypeEnum;
import com.xbongbong.pro.enums.AccessLinkEnum;
import com.xbongbong.saas.enums.XbbRefTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author shian
 * @create 2019-07-25 14:47
 * @desrcption 搜客的菜单
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum SearchCustomerMenuEnum {

    //挖掘线索
    EXCAVATE_CLUE(XbbRefTypeEnum.EXCAVATE_CLUE.getI18nName(), XbbRefTypeEnum.EXCAVATE_CLUE.getAlias(),
            XbbRefTypeEnum.EXCAVATE_CLUE.getCode(), AccessLinkEnum.EXCAVATE_CLUE, PaasConstant.HOME_STRING, MenuTypeEnum.MENU.getType()),
    //收藏夹
    COLLECTOR(XbbRefTypeEnum.COLLECTOR.getI18nName(), XbbRefTypeEnum.COLLECTOR.getAlias(),
            XbbRefTypeEnum.COLLECTOR.getCode(), AccessLinkEnum.COLLECTOR, PaasConstant.HOME_STRING, MenuTypeEnum.MENU.getType()),
    //我的线索
    INDIVIDUAL_CLUE(XbbRefTypeEnum.INDIVIDUAL_CLUE.getI18nName(), XbbRefTypeEnum.INDIVIDUAL_CLUE.getAlias(),
            XbbRefTypeEnum.INDIVIDUAL_CLUE.getCode(), AccessLinkEnum.INDIVIDUAL_CLUE, PaasConstant.HOME_STRING, MenuTypeEnum.MENU.getType()),
    //回收站
    RECYCLE_BIN(XbbRefTypeEnum.RECYCLE_BIN.getI18nName(), XbbRefTypeEnum.RECYCLE_BIN.getAlias(),
            XbbRefTypeEnum.RECYCLE_BIN.getCode(), AccessLinkEnum.RECYCLE_BIN, PaasConstant.HOME_STRING, MenuTypeEnum.MENU.getType()),
    //权限管理
    AUTHORITY_MANAGE(XbbRefTypeEnum.AUTHORITY_MANAGE.getI18nName(), XbbRefTypeEnum.AUTHORITY_MANAGE.getAlias(),
            XbbRefTypeEnum.AUTHORITY_MANAGE.getCode(), AccessLinkEnum.AUTHORITY_MANAGE, "controlCenter", MenuTypeEnum.MENU.getType());

    /**
     * 名称
     */
    private String name;

    /**
     * saas业务标识
     */
    private String alias;

    /**
     * saas业务标识
     */
    private Integer code;
    /**
     * 地址
     */
    private AccessLinkEnum accessLinkEnum;

    /**
     * 所属于哪个页面，home：首页；controlCenter：管理中心
     */
    private String belong;

    /**
     * 类型
     * @see MenuTypeEnum
     */
    private Integer type;

    public String getName() {
        return I18nMessageUtil.getMessage(name);
    }




    public static List<String> getAliasList() {
        List<String> list = new ArrayList<>();
        for (SearchCustomerMenuEnum searchCustomerMenuEnum: values()) {
            list.add(searchCustomerMenuEnum.getAlias());
        }
        return list;
    }

}
